Skip to content

feat: add crisis helpline numbers for 10 new countries#26

Open
smriti-nyx wants to merge 5 commits into
Vishisht16:mainfrom
smriti-nyx:feature/expand-crisis-helplines
Open

feat: add crisis helpline numbers for 10 new countries#26
smriti-nyx wants to merge 5 commits into
Vishisht16:mainfrom
smriti-nyx:feature/expand-crisis-helplines

Conversation

@smriti-nyx
Copy link
Copy Markdown

Description

Brief description of what this PR does :
Closes #1

Added crisis helpline numbers for 14 countries in humane_proxy/config.yaml block_message:
USA, UK, Canada, Australia, India, Japan, South Korea, Germany, France, Spain, Italy, Mexico, New Zealand, Brazil.

Formatting matches existing style with flag emojis. No existing entries removed.

Type of Change

  • Bug fix
  • [ x] New feature
  • Breaking change
  • Documentation update

Checklist

  • I have read the CONTRIBUTING guide
  • [ x] My code follows the project's style
  • I have added tests for new or changed behaviour
  • All tests pass (pytest tests/ -v)
  • I have updated documentation if needed
  • [x ] Self-harm / safety-related changes have been reviewed for sensitivity

@smriti-nyx smriti-nyx requested a review from Vishisht16 as a code owner May 20, 2026 07:29
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 20, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 063ca3e3-ad7a-4a5f-96e7-051eca081818

📥 Commits

Reviewing files that changed from the base of the PR and between 44ac11f and cdb2bdb.

📒 Files selected for processing (2)
  • humane_proxy/escalation/router.py
  • tests/test_care_response.py
✅ Files skipped from review due to trivial changes (1)
  • humane_proxy/escalation/router.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/test_care_response.py

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Expanded crisis support resources with helpline information for Japan, South Korea, Spain, Italy, Mexico, New Zealand, and additional France contacts.

Walkthrough

Expand the crisis helpline coverage in the default CARE_RESPONSE_BLOCK message by adding self-harm hotline entries for Japan, South Korea, Spain, Italy, Mexico, and New Zealand, then add tests asserting the presence of each country's helpline identifier.

Changes

International Crisis Helpline Expansion

Layer / File(s) Summary
Expand international helplines in CARE_RESPONSE_BLOCK
humane_proxy/escalation/router.py
Insert country-specific crisis helpline entries for Japan, South Korea, Spain, Italy, Mexico, and New Zealand into the CARE_RESPONSE_BLOCK response string.
Add verification tests for new countries
tests/test_care_response.py
Introduce TestCareResponseBlockNewCountries with assertions verifying each of the six newly added countries' helpline identifiers are present in the default message.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Six new helpers join the caring crew,
From Tokyo to Auckland, tried and true,
Crisis lines now span the globe so wide,
Tests confirm each number's there with pride,
A hopeful message, worldwide and bright! 🌍

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding crisis helpline numbers for multiple new countries, which is the primary objective of the PR.
Description check ✅ Passed The description is related to the changeset, mentioning added crisis helpline numbers for 14 countries and noting formatting consistency, though it lists the old config.yaml location rather than the final router.py location.
Linked Issues check ✅ Passed The PR meets the core objectives of issue #1: adds verified crisis helpline numbers for multiple countries (Japan, South Korea, Spain, Italy, Mexico, New Zealand) to the CARE_RESPONSE_BLOCK, maintains formatting consistency, preserves existing entries, and includes automated test assertions.
Out of Scope Changes check ✅ Passed All changes are within scope: helpline additions to router.py CARE_RESPONSE_BLOCK and corresponding test assertions align with issue #1 objectives; no unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@humane_proxy/config.yaml`:
- Around line 202-220: The YAML under the self_harm section has block_message
indented incorrectly causing parse errors; move the block_message key and its
multiline value so that block_message is aligned at the same indentation level
as always_escalate, escalate_threshold, and response_mode within the self_harm
mapping (i.e., unindent the block_message block to match those sibling fields)
so the multiline | block is properly nested under self_harm.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 59ab4162-f3a0-42a6-b9c4-012f71cc10f7

📥 Commits

Reviewing files that changed from the base of the PR and between c2e0825 and 3525848.

📒 Files selected for processing (1)
  • humane_proxy/config.yaml

Comment thread humane_proxy/config.yaml Outdated
@Vishisht16
Copy link
Copy Markdown
Owner

@smriti-nyx thanks for your work and apologies for not being active due to exams.

Actually, #1 is an old issue and now, we've kept block_message in humane_proxy/config.yaml as an override.
Can you please revert the change in block_message and keep it as ""? The care helpline addition must be done to CARE_RESPONSE_BLOCK in humane_proxy/escalation/router.py without duplication and assertions must be added for new country numbers in tests/test_care_response.py. Also, a few of those numbers seem to be outdated so please double check them before adding.

You can simply add this change as a new commit to your branch. Thanks for your understanding.

@smriti-nyx
Copy link
Copy Markdown
Author

smriti-nyx commented May 24, 2026 via email

@smriti-nyx
Copy link
Copy Markdown
Author

@smriti-nyx thanks for your work and apologies for not being active due to exams.

Actually, #1 is an old issue and now, we've kept block_message in humane_proxy/config.yaml as an override. Can you please revert the change in block_message and keep it as ""? The care helpline addition must be done to CARE_RESPONSE_BLOCK in humane_proxy/escalation/router.py without duplication and assertions must be added for new country numbers in tests/test_care_response.py. Also, a few of those numbers seem to be outdated so please double check them before adding.

You can simply add this change as a new commit to your branch. Thanks for your understanding.

Hi @Vishisht16, I've addressed all the feedback:

  • Reverted block_message to "" in humane_proxy/config.yaml
  • Moved the helpline numbers to CARE_RESPONSE_BLOCK in humane_proxy/escalation/router.py
  • Added assertions for all new countries in tests/test_care_response.py
  • Verified and corrected outdated numbers (Spain, Italy, Mexico)

All 212 tests passing locally. Please let me know if anything needs further changes!

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/test_care_response.py`:
- Around line 108-124: Tests like test_message_contains_spain_resource,
test_message_contains_italy_resource, test_message_contains_mexico_resource and
test_message_contains_new_zealand_resource are using permissive `or` checks that
allow provider names to pass; update each of these tests to assert the canonical
numeric helpline token exists in CARE_RESPONSE_BLOCK instead of allowing the
provider name: replace the `or` checks in test_message_contains_spain_resource
(use "717 003 717"), test_message_contains_italy_resource (use "02 2327 2327"),
test_message_contains_mexico_resource (use "5259-8121"), and
test_message_contains_new_zealand_resource (use "1737") so the tests require the
exact phone number string in CARE_RESPONSE_BLOCK.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1bf71fee-a7e8-479c-9baa-63470a1d7d4d

📥 Commits

Reviewing files that changed from the base of the PR and between 3525848 and 44ac11f.

📒 Files selected for processing (2)
  • humane_proxy/config.yaml
  • tests/test_care_response.py

Comment thread tests/test_care_response.py Outdated
Copy link
Copy Markdown
Owner

@Vishisht16 Vishisht16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smriti-nyx you added trailing blank lines in config.yaml, so please reset those.
Also, if you actually changed CARE_RESPONSE_BLOCK in router.py, it wasn't pushed so make sure it's there with the new numbers in the existing formatting.
CodeRabbit flagged your tests too, so also take a look at them. You must assert phone numbers instead of using or with org names,

I hope the next commit will be final.

@smriti-nyx
Copy link
Copy Markdown
Author

smriti-nyx commented May 27, 2026 via email

@smriti-nyx
Copy link
Copy Markdown
Author

I have fixed the trailing blank lines in config.yaml, added country helplines to router.py, and updated test assertions to use phone numbers directly. Please review!

Copy link
Copy Markdown
Owner

@Vishisht16 Vishisht16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few things to update before I approve it:

  1. You only added 7 countries instead of 10, which might've still been fine if you didn't add a duplicate for France. Just add the second number as another bullet in France.
  2. 🇯🇵 Japan has extra indentation so remove that.
  3. You didn't add test for France's second number so add that.
  4. Maintain consistency in the test file: 2 blank lines before class definition and another blank line at end of file.

All very minor changes but do this and we're good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Expand International Crisis Helpline Numbers in Default Config

3 participants